package com.example.ruiji.controller.tag;

import com.example.ruiji.pojo.Category;
import com.example.ruiji.pojo.Ltag;
import com.example.ruiji.service.ltag.LtagServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Author:BaiYiChen
 * Date:2022/5/2 11:06
 *
 * @author BaiYiChen
 */
@Controller
@RequestMapping("/tags")
public class TagDetail {
  @Autowired
  private LtagServiceImpl ltagService;
  @GetMapping("/showCategory/{aId}")
  public String showCategory(@PathVariable("aId")Integer id, Model model){
    Ltag ltag = ltagService.findLtagById(id);
    model.addAttribute("ltag", ltag);
    return "showCategoryByTags";
  }
}
